<#assign ctx=request.contextPath />
<div style="width:100%;height:100%;text-align: center;margin-top: 50px;">
    <form id="allowAccessIp_form_edit" method="patch">

        <div class="form-control">
            <textarea name="content"></textarea>
            <p class="help-block">添加允许访问系统的IP地址，多个用英文逗号分隔，不限制请清空内容</p>
        </div>
        <div class="form-control" style="text-align: center;">
            <a id="allowAccessIp_edit_save" href="#" class="easyui-linkbutton"
               data-options="iconCls:'icon-save'">保存</a>
        </div>
    </form>
</div>
<script type="text/javascript">

    $("#allowAccessIp_form_edit").form('load', '${ctx}/allowAccessIp/first.json');

    $("#allowAccessIp_edit_save").click(function () {
        //ajax 保存
        var params = $("#allowAccessIp_form_edit").serialize();

        core.func.patch("${ctx}/allowAccessIp.json", params, function (data) {
            if (data.status == 0) {
                $.messager.show({
                                    msg: "保存成功",
                                    title: "成功",
                                    timeout: 1000
                                });
            } else {
                $.messager.show({
                                    msg: "保存失败",
                                    title: "失败"
                                });
            }
        });
    });
</script>
